<layout name="layout" />
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>简易商城系统</title>
	<link rel="stylesheet" href="__css__backstage.css">
    <!-- Bootstrap -->
    <link href="__bootstrap__css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
<body>
    <div class="operation_user clearfix" id="all">
        <div class="link fl"><a href="#">商城</a><span>&gt;&gt;</span><a href="#">管理员管理</a><span>&gt;&gt;</span>管理员管理</div>
        <div class="link fr">
            <a href="#" class="icon icon_i">首页</a><span></span>欢迎您！
            <span>{$username}</span><a href="{:U('Home/Login/LoginOut')}" class="icon icon_e">退出</a>
        </div>
    </div>
    <div class="content clearfix">
        <div class="main">
            <!--右侧内容-->
            <div class="cont">
                <div class="title">管理员管理</div>
                <div class="details">
                    <div class="details_operation clearfix">
                        <div class="bui_select">
                        	<a href="{:U('AdminUserAdd/adminUserAdd')}" class="btn btn-primary">添&nbsp;&nbsp;加</a>
                        </div>
                        <div class="fr">
                            <form class="form-inline" id="selectUserName" method="get" action="{:U('Admin/Admin/Admin')}">
							  <div class="form-group">
							    <label for="userName">查找</label>
							    <input type="text" class="form-control" name="username" id="userName" placeholder="查找管理员名称">
							  </div>
							  <button type="submit" class="btn btn-primary" id="but">搜索</button>
							</form>
                        </div>
                    </div>
                    <!--表格-->
                    <table class="table table-striped" id="table">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>管理员名称</th>
                                <!--<th>创建时间</th>-->
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <volist name="list" id="vo">
                            <tr>
                                <td><input type="checkbox" name="c1" id="c1" value="{$vo.id}" class="check">{$vo.id}<label for="c1" class="label">{$vo.id}</label></td>
                                <td>{$vo.username}</td>
                                <!--<td>2016-4-3</td>-->
                                <td><a href="{:U('Admin/Admin/SaveAdmin')}?id={$vo.id}" name="save" class="btn btn-primary">修改</a><a href="#" class="btn btn-danger col-sm-offset-1" name="del" id="del">删除</a></td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <!-- Modal -->

                    <div class="page">
                        {$page}
                    </div>
                </div>
            </div>
        </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="__jquery__1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="__bootstrap__js/bootstrap.min.js"></script>
    <style>
	.nav-pills > li.active > a, .nav-pills > li.active > a:focus, .nav-pills > li.active > a:hover {
	    background-color: #eee;
	    color: #337ab7;
	}
        .page a,.page .num{
            float:left;
            text-decoration:none;
            color:#0e509e;
            border-right:solid 1px #DEDEDE; margin-right:2px;
            font-weight:bold;
            border:solid 1px #9aafe5;

        }
    .page a,.page .current{
        float:left;
        text-decoration:none;
        color:#0e509e;
        border-right:solid 1px #DEDEDE; margin-right:2px;
        font-weight:bold;
        border:solid 1px #9aafe5;

    }
    </style>
</body>
  <script type="text/javascript">
      $(function(){
          $("a[name='del']").click(function(){
              //获取checkbox选中的值
              var aa = document.getElementsByName("c1");
              var ss = "";
              for (var i = 0; i < aa.length; i++) {
                  if (aa[i].checked) {
                      ss += aa[i].value+",";
                  }
              }
              var ssLength = ss.length;
              if(ssLength>2 || ssLength<1){
                  if(confirm("请仅且选择“一条”数据！")){
                      $("#del");
                  }
              }
              $.post("{:U('Admin/Admin/Del')}",{id:ss},function(data){
                  if(data.flag){
                      location.replace(location.href);
                  }else{
                      alert("删除失败！");
                  }

              });
          });


      });
  </script>
</html>